package core.command
{
	import core.event.SocketEventID;
	import core.event.UnoEvent;
	import core.event.ViewEventID;
	
	public class LoginCommand extends SuperCommand
	{
		public function LoginCommand()
		{
			super();
			socketEvent = SocketEventID.LOGIN_SUCESS;
			viewEvent = ViewEventID.LOGIN_SUCESS;
		}
		override public function success(e:UnoEvent):void
		{
			db.roomList = e.data.server;
			db.loginUser.setup(e.data.user);
		}
		override public function fail(e:UnoEvent):void
		{
			dispatch.dispatchEvent(new UnoEvent(ViewEventID.LOGIN_FAIL,"login fail"));
		}
		
	}
}